package com.fbs.job.admin.core.enums;

public enum  ScheduleTypeEnum {
    NONE("无"),
    CRON("CRON"),
    FIX_RATE("固定速度");
    private String title;

    ScheduleTypeEnum(String title) {
        this.title = title;
    }

    public String getTitle() {
        return title;
    }


    public static ScheduleTypeEnum match(String name, ScheduleTypeEnum defaultItem){
        for (ScheduleTypeEnum item: ScheduleTypeEnum.values()) {
            if (item.name().equals(name)) {
                return item;
            }
        }
        return defaultItem;
    }
}
